load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "authproxy",
    srcs = [
        "http.go",
        "server.go",
        "socket.go",
    ],
    importpath = "go.f110.dev/heimdallr/pkg/authproxy",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/auth",
        "//pkg/auth/authn",
        "//pkg/auth/authz",
        "//pkg/config/configv2",
        "//pkg/connector",
        "//pkg/database",
        "//pkg/logger",
        "//pkg/rpc/rpcclient",
        "//pkg/session",
        "//pkg/stat",
        "//vendor/github.com/golang-jwt/jwt",
        "//vendor/github.com/google/go-github/v41/github",
        "//vendor/go.uber.org/zap",
        "//vendor/go.uber.org/zap/zapcore",
        "//vendor/golang.org/x/xerrors",
    ],
)

go_test(
    name = "authproxy_test",
    srcs = [
        "http_test.go",
        "main_test.go",
        "server_test.go",
        "socket_test.go",
    ],
    embed = [":authproxy"],
    deps = [
        "//pkg/auth",
        "//pkg/cert",
        "//pkg/config/configv2",
        "//pkg/database",
        "//pkg/database/memory",
        "//pkg/logger",
        "//pkg/netutil",
        "//pkg/rpc/rpcclient",
        "//pkg/session",
        "//vendor/github.com/stretchr/testify/assert",
        "//vendor/github.com/stretchr/testify/require",
    ],
)
